<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="ot" uri="http://www.ideyatech.com/tides"%>
<%@ taglib prefix="idy" tagdir="/WEB-INF/tags"%>

<c:set var="ot_version" value="1.0" scope="application" />
<c:set var="url_context" value="${pageContext.request.contextPath}" scope="application" />
<c:set var="url_bootstrap" value="${url_context}/bootstrap" scope="application" />
<c:set var="url_style" value="${url_context}/styles" scope="application" />
<c:set var="url_script" value="${url_context}/script/ideyatech-${ot_version}" scope="application" />
<c:set var="url_script_iris" value="${url_context}/script" scope="application" />
<c:set var="url_script_lib" value="${url_script_iris}/js-libraries" scope="application" />

<jsp:useBean id="currentUser" class="org.opentides.util.SecurityUtil" />
<c:if test="${not empty currentUser.user}">
	<c:redirect url="/home.jspx"/>
</c:if>

<c:if test="${empty currentUser.user}">
	<!DOCTYPE html>
	<html lang="en">
		<head>
			<meta name="viewport" content="width=device-width, initial-scale=1.0">
			<link rel="icon" type="image/x-icon" href="${url_context}/images/favicon.ico" />
			
			<title>IRIS | Interactive Recording Integration System</title>
	        
	        
	        <!-- BOOTSTRAP -->
	        <link href="${url_context}/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
	        
			<!-- STYLE -->
<%-- 			<link rel="stylesheet" type="text/css" href="${url_style}/morphlynx-welcome.css?v=4" /> --%>
<%-- 			<link rel="stylesheet" type="text/css" href="${url_style}/morphlynx-access-validator.css?v=1" /> --%>
<%-- 			<link rel="stylesheet" type="text/css" href="${url_bootstrap}/css/bootstrap.min.css"/> --%>
<!-- 			<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen"> -->
<%-- 			<link rel="stylesheet" type="text/css" href="${url_style}/iris-all.css"/> --%>
			<link rel="stylesheet" type="text/css" href="${url_style}/iris-login.css"/>
			
	      	<!-- JQUERY -->
	        <script type="text/javascript" src="${url_script_lib}/jquery-1.7.2.js"></script>
	        
	        <!-- JQUERY UI -->
	        <link rel="stylesheet" type="text/css" href="${url_script_lib}/jquery-ui/theme/jquery.ui.all.css" />
	        <script type="text/javascript" src="${url_script_lib}/jquery-ui/jquery-ui-1.8.22.custom.js"></script>
	       	
			<!-- IDEYATECH SCRIPTS -->
	        <script src="${url_script}/crud.js"></script>
<%-- 	        <script src="${url_script_iris}/morphlynx-access-validator.js"></script> --%>
	
	        <!-- TINYBOX 2 -->
	        <link rel="stylesheet" type="text/css" href="${url_script_lib}/tinybox2/tinybox.css" />
	        <script src="${url_script_lib}/tinybox2/tinybox.js"></script>
	
		</head>
		
		<body>
			<div class="container">
				<div class="row">
					<div class="span4 offset4 fields-container">
						<form id="login-form" action="<c:url value='j_spring_security_check'/>" method="POST">
<!-- 							<div class="row"> -->
								<div class="fields">
									<div class="control-group">
										<label class="control-label">Username</label>
										<div class="controls">
											<input type='text' name='j_username' placeholder="Username" required="required" autocomplete="off"/>
										</div>
									</div>
									<div class="control-group">
										<label class="control-label">Password</label>
										<div class="controls">
											<input type='password' name='j_password' placeholder="Password" required="required" autocomplete="off"/>
										</div>
									</div>
									
									<div class="control-group">
										<div class="controls">
											<label class="checkbox">
												<input type='checkbox' name='_spring_security_remember_me' id="auto-login"/>Remember me
											</label>
											<input id="login-button" class="btn btn-primary btn-block" type="submit" value="Login" />
										</div>
									</div>
									<c:if test="${not empty param.login_error}">
										<div class='errorBox'>
											<p class="text-error"><strong>
												<spring:message code='error.${param.login_error}' />
												<c:out value="${SPRING_SECURITY_LAST_EXCEPTION.message}" />
											</strong></p>
										</div>
									</c:if>
								</div>
<!-- 							</div> -->
						</form>
					</div>
				</div>
			</div>
		</body>
	</html>
</c:if>
